package com.yungu.swift.report.controller;

import com.yungu.swift.base.ResponseData;
import com.yungu.swift.base.model.admin.AdminReportParam;
import com.yungu.swift.report.entity.ReportUserActiveDay;
import com.yungu.swift.report.service.UserActiveDayService;
import com.yungu.swift.report.service.UserOriginProvinceDayService;
import com.yungu.swift.utils.MapUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 用户统计控制器
 *
 * @author XiuYin.Cui
 */
@RestController
@Api(value = "【乘客统计】", tags = "乘客统计")
public class UserDayCtrl {
    @Autowired
    private UserOriginProvinceDayService userOriginProvinceDayService;
    @Autowired
    private UserActiveDayService userActiveDayService;


    @PostMapping("/report/user/originCity/list")
    @ApiOperation(value = "用户发单区域分布", httpMethod = "POST")
    public ResponseData<List<Map<String, Object>>> getOriginProvinceList(@RequestBody AdminReportParam reportParam) {
        return userOriginProvinceDayService.list(reportParam);
    }


    @PostMapping("/report/user/activeRateDay/list")
    @ApiOperation(value = "每日活跃度", httpMethod = "POST")
    public ResponseData<List<ReportUserActiveDay>> getActivityRateDayList(@RequestBody AdminReportParam reportParam) {
        return userActiveDayService.getActivityRateDayList(reportParam);
    }
}
